// 评论接口
import request from "@/utils/request";

//  请求获取评论数据
export const getComment = (params) => {
  return request({
    method: "GET",
    url: "/v1_0/comments",
    params,
  });
};

//  对评论点赞
export const addComment = (target) => {
  return request({
    method: "POST",
    url: "/v1_0/comment/likings",
    data: { target },
  });
};

//  取消对评论点赞
export const delComment = (target) => {
  return request({
    method: "DELETE",
    url: `/v1_0/comment/likings/${target}`,
  });
};

//  取消对评论点赞
export const commentPost = (data) => {
  return request({
    method: "POST",
    url: `/v1_0/comments`,
    data,
  });
};
